﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _20170228_GenericQueue
{
    class Program
    {
        static void Main(string[] args)
        {
            GenericQueue<String> myQueue = new GenericQueue<string>(5);
            myQueue.Push("123");
            Console.WriteLine("Head {0}  Tail {1}", myQueue.pointerHead, myQueue.pointerTail);
            Console.WriteLine(myQueue);
            Console.WriteLine(myQueue[0]);
            Console.WriteLine(myQueue[1]);
            myQueue.Push("234");
            Console.WriteLine("Head {0}  Tail {1}", myQueue.pointerHead, myQueue.pointerTail);
            Console.WriteLine(myQueue);
            myQueue.Push("345");
            Console.WriteLine("Head {0}  Tail {1}", myQueue.pointerHead, myQueue.pointerTail);
            Console.WriteLine(myQueue);
            myQueue.Push("456");
            Console.WriteLine("Head {0}  Tail {1}", myQueue.pointerHead, myQueue.pointerTail);
            Console.WriteLine(myQueue);
            myQueue.Push("567");
            Console.WriteLine("Head {0}  Tail {1}", myQueue.pointerHead, myQueue.pointerTail);
            Console.WriteLine(myQueue);
            myQueue.Push("678");
            Console.WriteLine("Head {0}  Tail {1}", myQueue.pointerHead, myQueue.pointerTail);
            Console.WriteLine(myQueue);
            myQueue.Push("789");
            Console.WriteLine("Head {0}  Tail {1}", myQueue.pointerHead, myQueue.pointerTail);
            Console.WriteLine(myQueue);
            myQueue.Push("89A");
            Console.WriteLine("Head {0}  Tail {1}", myQueue.pointerHead, myQueue.pointerTail);
            Console.WriteLine(myQueue);
            myQueue.Push("9AB");
            Console.WriteLine("Head {0}  Tail {1}", myQueue.pointerHead, myQueue.pointerTail);
            Console.WriteLine(myQueue);
            myQueue.Push("ABC");
            Console.WriteLine("Head {0}  Tail {1}", myQueue.pointerHead, myQueue.pointerTail);
            Console.WriteLine(myQueue);
            myQueue.Push("BCD");
            Console.WriteLine("Head {0}  Tail {1}", myQueue.pointerHead, myQueue.pointerTail);
            Console.WriteLine(myQueue);
            Console.WriteLine(myQueue.Pop());
            Console.WriteLine(myQueue);
            Console.WriteLine(myQueue.Pop());
            Console.WriteLine(myQueue);
            Console.WriteLine(myQueue.Pop());
            Console.WriteLine(myQueue);
            Console.WriteLine(myQueue.Pop());
            Console.WriteLine(myQueue);
            Console.WriteLine(myQueue.Pop());
            Console.WriteLine(myQueue);
            Console.WriteLine(myQueue.Pop());
            Console.WriteLine(myQueue);


        }
    }
}
